package c.c.k.util;

import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

public class StockUtil {
    public static void parseJsonObject(String url, HttpJsonObjectCallback callback){
        callback.callback(JSONUtil.parseObj(HttpUtil.get(url)));
    }
    public static void parseJsonArray(String url, HttpJsonArrayCallback callback){
        callback.callback(JSONUtil.parseArray(HttpUtil.get(url)));
    }

    public interface HttpJsonObjectCallback{
        void callback(JSONObject jsonObject);
    }

    public interface HttpJsonArrayCallback{
        void callback(JSONArray jsonArray);
    }
}
